<?php
	include "layout.php";
	$id = $_GET["id"];
?>
<h2 style="text-align: center;">Order #<?php echo $id; ?></h2>
<table width="100%" cellpadding="0" cellspacing="0">
	<tr>
		<th>Item Description</th>
		<th>Item Type</th>
	</tr>
<?php
	$query = mysql_query("SELECT * FROM oa_items WHERE OAI_OrderAcc_ID = {$id}");
	while ($result = mysql_fetch_array($query)) {
		$items = mysql_query("SELECT * FROM items WHERE Items_ID = {$result["OAI_Items_ID"]}");
		$item = mysql_fetch_array($items);
		if ($item["Item_Cat"] == "C") {
			$cat = "Chips";
		}
		if ($item["Item_Cat"] == "B") {
			$cat = "Baked Good";
		}
		if ($item["Item_Cat"] == "G") {
			$cat = "Gum";
		}
		if ($item["Item_Cat"] == "H") {
			$cat = "Healthy Alternative";
		}
		echo <<<Print
	<tr>
		<td>{$item["Items_Description"]}</td>
		<td>{$cat}</td>
	</tr>
Print;
	}
?>
</table>